﻿@model foodandgo.ViewModels.PlaceDetail
@{
    Layout = "../Shared/_DetailLayout.cshtml";
}
<div class="micro-container">
            <div class="micro-content" itemscope itemtype="http://schema.org/Restaurant">
                <div class="microsite-basic-info">
                    <!--Start microsite header-->
                    <div id="fb-root">
                    </div>
                    <!--Start microsite header-->

                   
                    @Html.Partial("_InfoBox", Model)
                    

                    <!--begin navbar -->
                    @Html.Partial("_PlaceMenu")
                    <!--End nav bar-->

                    <div id="report-info-dialog" style="display: none" class="reporterrortooltip">
                        <div>
                            <div style="padding-bottom: 5px;"><span class="errorkeyname"></span></div>
                            <div style="padding-top: 3px;">
                                <textarea class="correctinfotextbox" spellcheck="false"></textarea>
                            </div>
                            <div class="top-arrow">
                                <img alt="" src="/Images/icons/arrow-top.png">
                            </div>
                            <div><a class="send-resinfo-error" reporttype="1">Gửi thông tin</a></div>
                            <div class="report-wating" style="display: none">
                                <img src="/Images/icons/loading.gif" /></div>
                            <div class="report-success"></div>
                            <div class="report-fail"></div>
                        </div>

                    </div>
                    <div id="report-properties-dialog" style="display: none; height: 120px;" class="reporterrortooltip">
                        <div>
                            <div style="padding-bottom: 5px;"><span class="errorkeyname"></span></div>
                            <div class="left-arrow">
                                <img alt="" src="/images/icons/arrow-left.png">
                            </div>
                            <div>
                                <label>
                                    <input type="radio" value="true" name="property-truth" />Có</label>
                                <label>
                                    <input type="radio" value="false" name="property-truth" />Không</label>
                            </div>
                            <div style="padding-top: 3px;">
                                <textarea class="correctinfotextbox" spellcheck="false"></textarea>
                            </div>
                            <div><a class="send-resproperties-error" reporttype="2">Gửi thông tin</a></div>
                            <div class="report-wating" style="display: none">
                                <img src="/images/icons/loading.gif" /></div>
                            <div class="report-success"></div>
                            <div class="report-fail"></div>
                        </div>

                    </div>
            
                    <div id="review-report-dialog">
                        <div class="top-arrow">
                            <img src="/images/icons/arrow-top.png" alt="">
                        </div>
                        <div>
                            <input type="hidden" id="review-error-hd" />
                            <div style="padding-bottom: 5px;"><span class="errorkeyname">Báo lỗi bình luận</span></div>

                            <div>
                                <textarea class="correctinfotextbox" spellcheck="false"></textarea>
                            </div>
                            <div><a class="send-resinfo-error">Gửi thông tin</a></div>
                            <div class="report-wating" style="display: none">
                                <img src="/images/icons/loading.gif" /></div>
                            <div class="report-success"></div>
                            <div class="report-fail"></div>
                        </div>
                    </div>
    
                    <div>
                        
                     <div id="toolAddWishlist" style="display: none; position: absolute; z-index: 99;">
                            <ul>
                                <li class="tool-custom-list">


                                    <div class="custom-list-wrapper">
                                        <div class="list-addmore-but">
                                            <span style="float: left; margin-right: 10px;">Chọn list để lưu lại </span>
                                            <span data-bind="visible:Processing" style="float: left; margin-top: 2px;">
                                                <img src="/images/icons/ajax-loader.gif" alt="loading..." /></span>
                                        </div>
                                        <ul data-bind="foreach:Lists" style="max-height: 150px; overflow: auto;">
                                            <li style="position: relative; overflow: hidden;">
                                                <a data-bind="attr:{'data-name':Name}, css:{'checked':RestaurantId()==$parent.RestaurantId()}, click:$parent.ToggleSelection">
                                                    <span class="list-label" data-bind="text:Title"></span>
                                                </a>
                                                <a data-bind="attr:{href:Url}" class="custom-list-link" title="Go to list" style="float: right; padding: 4px 2px; text-align: center; width: 30px; position: absolute; right: 0px; top: 0px;"></a>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li style="background: #d0ecfd; border-top: #ccc 1px solid;">
                                                <a href="#" data-bind="click:ListAction" style="font-style: italic; color: #0074D9; border-bottom: none;">+ Tạo list mới</a></li>
                                        </ul>
                                    </div>

                                </li>
                            </ul>
                            <div id="wishListFormWrapper" style="display: none;"></div>
                        </div>

                    </div>


                    <!--End of microsite header-->

                    <!--End of microsite header-->
                </div>
                <!--Start Micro content-->
                <div class="micro-main-content">
                    <!--Start Left content -->
                    <div class="micro-left">
                       
                        <!--Start promotion box -->
                        <!--End of promotion box -->
                        <!--Start Microsite Intro box -->




                            @Html.Partial("_ReviewBox");
            

                        @Html.Partial("_ImageBox");

                        @Html.Partial("_DetailBox");

                        <div class="claim-butt">
                            <div>Bạn là Chủ/Quản lý của @Model.Place.Name ?
                                <br />
                                Bạn muốn quản lý thông tin địa điểm này?</div>
                            <div class="claim"><a target="_blank" rel="nofollow" href="http://manager.foody.vn/home/claimdetail/24426" class="claim-buttons">Đăng ký sử dụng Công cụ Quản lý</a></div>
                        </div>

                        <!--End of Microsite Intro Box -->

                    </div>
                    <!--End of Left content -->
                    <!--Start Right content -->
                    <div class="micro-right">
                        <div class="microsite-box-right" style="">
                            <div class="microsite-box-heading-right">
                                <div class="title">
                                    Đặc điểm nổi bật
                                </div>
                            </div>
                            <div class="microsite-box-content-right special-content disableSelection">
                                <ul>
                                    @{
                                        foreach (var s in Model.Place.Description.Split('|'))
                                        {
                                            <li>@s</li>
                                        }
                                    }
                                    
                                </ul>

                            </div>
                        </div>


                        <style>
                            .special-menus {
                                width: 270px;
                                float: left;
                                padding: 10px 0 10px 15px !important;
                                font-size: 12px;
                            }

                                .special-menus ul li {
                                    background: url(/images/icons/special-menu2.png) no-repeat;
                                    padding-bottom: 2px;
                                    padding-left: 20px;
                                    line-height: 1.7em;
                                    background-position: 0px 2px;
                                }
                        </style>



                        <script type="text/javascript">
      
                            var map; 
                            var infowindow;
                            function InitializeMap() {
                                var ltlng = new google.maps.LatLng('10.7690510000000', '106.6712380000000');

                                var myOptions =
                                {
                                    zoom: 15,
                                    center: ltlng,
                                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                                    mapTypeControl: false
                                };
                                map = new google.maps.Map(document.getElementById("map"), myOptions);            

                                map.setCenter(ltlng);
                                marker = new google.maps.Marker({
                                    map: map,
                                    position: ltlng
                                });

                                (function (marker) {

                                    google.maps.event.addListener(marker, 'click', function () {

                                        if (!infowindow) {
                                            infowindow = new google.maps.InfoWindow();
                                        }

                                        infowindow.setContent(@Model.Place.Name);

                                        infowindow.open(map, marker);

                                    });

                                })(marker);
                            }      
                            var mapModel;
                            function InitializeMapLarge() {
                                if(!mapModel){
                                    mapModel = new RestaurantListModel({
                                        provinceId: provinceId,
                                        searchUrl: '/directory/restaurantinrange',
                                        loadingElementId: '#loading-img',
                                        mapId: 'mapLarge',
                                        zoomLevel: 16,
                                        defaultLat: 0,
                                        defaultLon: 0,
                                        mapType: 'large',
                                        mainRestaurantId: 24426,
                                        mainCategoryId: 1
                                    });

            
                                    mapModel.lat(10.7690510000000);
                                    mapModel.long(106.6712380000000);
                                }
                                if(mapModel.restaurants().length==0){
                                    mapModel.loadData(1, false, function(){
                                        //mapModel.showMap(true);
                                        ko.applyBindings(mapModel, document.getElementById('mapDialog'));
                                    });
                                }
                            }                
    
                            $(function () {
                                InitializeMap();

                                $('.linkmap').click(function () {
                                    if(window.location.hash!="#map")
                                    {
                                        window.location.hash="#map";
                                    }
                                    loadMicroMap();                
                                    return false;
                                });

                                if(window.location.hash=="#map")
                                {
                                    loadMicroMap();
                                }
                            });
        
                            function loadMicroMap(){
                                $('#mapDialog').modal({persist: true, onClose:function(){
                                    window.location.hash="";
                                    $.modal.close();
                                } });
                                InitializeMapLarge();
                            }
                            // edit map
                            var editmap, editInfoWindow;

                            function InitializeEditMap() {
                                var latlng;
                                var myOptions =
                                {
                                    zoom: 15,
                                    center: latlng,
                                    mapTypeId: google.maps.MapTypeId.ROADMAP
                                };
                                editmap = new google.maps.Map(document.getElementById("edit-map"), myOptions);            
                            }
                            var editmarker;
                            var oldltlng;
                            function markediticons() {

                                InitializeEditMap();

                                oldltlng = new google.maps.LatLng(parseFloat(parseLocalNum('10,7690510000000')), parseFloat(parseLocalNum('106,6712380000000')));

                                editmap.setCenter(oldltlng);
                                editmarker = new google.maps.Marker({
                                    map: editmap,
                                    position: oldltlng,
                                    draggable: true
                                });
            
                                google.maps.event.addListener(editmarker, 'click', function () {

                                    if (!editInfoWindow) {
                                        editInfoWindow = new google.maps.InfoWindow();
                                    }

                                    editInfoWindow.setContent(@Model.Place.Name);

                                    editInfoWindow.open(mapedit, editmarker);

                                });
                            }
                        </script>
                        <script type="text/javascript">
                            function openMapReport(){
                                $.modal.close();
                                $('#edit-map-dialog').modal();
                                $('#simplemodal-container').css('height', '400px');
                                $('#simplemodal-container').css('width', '620px');
                                $(window).resize();

                                markediticons();
                            }
                            $(function () {        

                                $('.map-report').click(function () {
                                    LoginPopup.RequiredLogin(openMapReport);            
                                    return false;
                                });

                                $('#map-report-button').click(function(){
                                    var newlatitude = editmarker.getPosition().lat();
                                    var newlongitude = editmarker.getPosition().lng();
                                    if(oldltlng.lat() != newlatitude || oldltlng.lng() != newlongitude)
                                    {
                                        var data = {
                                            restaurantId: '24426',
                                            errorkeyname: 'restaurant map',
                                            correctinfo: 'Lat: '+newlatitude +'; Long: '+newlongitude,
                                            type: '3',
                                            istrue: false,
                                            reporturl: window.location.href
                                        };
                                        $.post("/Restaurant/AddReportError", data, function (response) {
                                            if (response.success) {
                                                $('.report-map-success').show();
                                                $('.report-map-fail').hide();
                                                //oldltlng.kb = newlatitude;
                                                //oldltlng.jb = newlongitude;
                                                oldltlng = new google.maps.LatLng(newlatitude, newlongitude, true);
                                            }
                                            else {
                                                $('.report-map-success').hide();
                                                $('.report-map-fail').show();
                                            }
                                        });
                                    }
                                });
                            });
    

                        </script>
                        <div id="mapDialog" style="display: none;">
                            <div class="linkmap-title">
                                <span>Bản đồ</span> <span data-bind="text: mainRestaurant().Name"></span>


                                <a href="javascript:void(0)" class="map-report" style="float: right; color: #029FC6; font-size: 13px;">Báo lỗi vị trí</a>
                                <img id="loading-img" src="/images/icons/loading.gif" alt="Loading..." style="float: right; margin-right: 20px; display: none;">
                            </div>
                            <div style="border: #ddd 1px solid; clear: both; width: 100%; height: 400px; margin-bottom: 15px;">
                                <div id="mapLarge" class="larger-map">
                                </div>
                                <div class="map-filters">
                                    <div style="display: none">
                                        <h3>Hướng dẫn đường đi</h3>
                                        <div style="color: #777;">
                                            Bạn đang ở đâu?
                                        </div>
                                        <div>
                                            <input type="text" style="border: #ccc 1px solid; padding: 4px; width: 155px; margin-top: 3px;" />
                                        </div>
                                        <div>
                                            <input type="button" value="Chỉ đường" class="map-rout" />
                                        </div>
                                    </div>
                                    <h3 style="margin-top: 20px;">Địa điểm xung quanh</h3>
                                    <div class="map-filter-nhahang">
                                        <div class="title">
                                            Nhà Hàng (<span data-bind="text: nhaHangCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: nhaHangShowText, click:function(){handleRestaurantDisplay(category.NHAHANG)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-quanan">
                                        <div class="title">
                                            Quán Ăn (<span data-bind="text: quanAnCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: quanAnShowText, click:function(){handleRestaurantDisplay(category.QUANAN)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-cafe">
                                        <div class="title">
                                            Cafe/Kem (<span data-bind="text: cafeCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: cafeShowText, click:function(){handleRestaurantDisplay(category.CAFE)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-bar">
                                        <div class="title">
                                            Bar/Pub (<span data-bind="text: barpubCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: barpubShowText, click:function(){handleRestaurantDisplay(category.BARPUB)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-tiembanh">
                                        <div class="title">
                                            Tiệm Bánh (<span data-bind="text: tiemBanhCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: tiemBanhShowText, click:function(){handleRestaurantDisplay(category.TIEMBANH)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-karaoke">
                                        <div class="title">
                                            Karaoke (<span data-bind="text: karaokeCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: karaokeShowText, click:function(){handleRestaurantDisplay(category.KARAOKE)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-resort">
                                        <div class="title">
                                            Khu du lịch (<span data-bind="text: resortCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: resortShowText, click:function(){handleRestaurantDisplay(category.RESORT)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-billiards">
                                        <div class="title">
                                            Billiards (<span data-bind="text: billiardsCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: billiardsShowText, click:function(){handleRestaurantDisplay(category.BILLIARDS)}">ẩn</a>
                                        </div>
                                    </div>
                                    <div class="map-filter-tiec-cuoi-hoi-nghi">
                                        <div class="title">
                                            Tiệc cưới - hội nghị (<span data-bind="text: tiecCuoiHoiNghiCount">0</span>)
                                        </div>
                                        <div class="control">
                                            <a data-bind="text: tiecCuoiHoiNghiShowText, click:function(){handleRestaurantDisplay(category.TIECCUOI_HOINGHI)}">ẩn</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="microsite-map">
                            <a href="javascript:void(0)" id="map-report-error" class="map-report">báo lỗi vị trí</a>
                            <div id="map" style="width: 299px; height: 259px;">
                            </div>
                            <div class="microsite-map-link">
                                <a class="linkmap" title="Xem bản đồ lớn" style="right: -46px; top: 6px;">
                                    <img src="/images/icons/zoom-map.png" alt="View larger map" alt="Xem bản đồ lớn" /></a>
                            </div>
                        </div>
                        <div>

                            <div id="edit-map-dialog" style="display: none">
                                <div class="linkmap-title">
                                    <span style="border: 0px;">Cập nhật lại vị trí</span>
                                </div>
                                <div id="edit-map" style="width: 600px; height: 330px;"></div>
                                <div>
                                    <a href="javascript:void(0)" id="map-report-button">Gửi thông tin </a>
                                </div>
                                <span class="map-tip">Rê chuột lên nắm vào icon đánh dấu, kéo và thả vào vị trí đúng của địa điểm</span>
                                <span class="report-map-success" style="display: none">Gửi thông tin thành công</span>
                                <span class="report-map-fail" style="display: none">Vui lòng chọn lại vị trí</span>
                            </div>
                        </div>




                        <!--Lovers-->
                        <div id="favourite-users-box">
                            <div class="microsite-box-right" style="">
                                <div class="microsite-box-heading-right">
                                    <div class="title">
                                        Thành viên yêu thích
                                    </div>
                                </div>
                                <div class="microsite-box-content-right lover">
                                    <div id="top-favourite-users-box">
                                        <div class="microsite-lovers-item">
                                            <div>
                                                <a href="/thanh-vien/letiendungbk">
                                                    <img src="http://media.foody.vn/avatar/resize/profile_b192_634990498281095000_m_cropped_65.png" height="65" width="65" /></a>
                                            </div>
                                            <div>
                                                <a href="/thanh-vien/letiendungbk">dung</a>
                                            </div>
                                        </div>
                                    </div>


                                </div>
                            </div>

                        </div>

                        <!--End of Lovers-->
                        <!--latest review box -->


                        <div class="claim-butt">
                            <div>Bạn là Chủ/Quản lý của @Model.Place.Name ?
                                <br />
                                Bạn muốn quản lý thông tin địa điểm này?</div>
                            <div class="claim"><a target="_blank" rel="nofollow" href="http://manager.foody.vn/home/claimdetail/24426" class="claim-buttons">Đăng ký sử dụng Công cụ Quản lý</a></div>
                        </div>


                        <div class="microsite-box-right">
                            <div class="microsite-box-heading-right">
                                <div class="title">
                                    Địa điểm lân cận
                                </div>
                            </div>
                            <div class="microsite-box-content-right">
                                <div class="microsite-right-item">
                                    <div class="img">
                                        <a href="/ho-chi-minh/mua-vang">
                                            <img src="http://media.foody.vn/restaurant/foody-mua-vang_100.jpg" alt="M&#249;a V&#224;ng - Ẩm Thực V&#249;ng Miền" /></a>
                                    </div>
                                    <div class="micro-related-content">
                                        <div class="title">
                                            <h2><a href="/ho-chi-minh/mua-vang">M&#249;a V&#224;ng - Ẩm Thực V&#249;ng Miền </a></h2>
                                        </div>
                                        <div class="address">
                                            <span>197 Cổng B4 Th&#224;nh Th&#225;i, P. 14</span>, <span>Quận 10</span>
                                        </div>
                                        <div>
                                            <div class="point">
                                                <span>9.0</span>
                                            </div>
                                            <div class="review">
                                                <a class="restaurant-reviews-link" resid="5361" href="javascript:void(0)"><span>1</span> bình luận</a>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                               

                            </div>
                        </div>


                        <!--Start keywords category box-->
                        <div class="microsite-box-right">
                            <div class="microsite-box-heading-right">
                                <div class="title">
                                    Khu vực Q. 10
                                </div>
                            </div>
                            <div class="microsite-box-content-right" style="padding: 0; width: 300px;">

                                <div id="areas-block">
                                    <ul class="microsite-areas">
                                        <li><a href="/ho-chi-minh/khu-vuc-nga-sau-nguyen-tri-phuong">Ng&#227; S&#225;u Nguyễn Tri Phương<span>147</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-bac-hai">Bắc Hải<span>122</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-nga-bay-ly-thai-to">Ng&#227; Bảy L&#253; Th&#225;i Tổ<span>121</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-big-c-mien-dong">Big C Miền Đ&#244;ng<span>86</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-ky-hoa">Kỳ H&#242;a<span>80</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-vong-xoay-32-cmt8">C&#244;ng Trường D&#226;n Chủ 3/2 - CMT8<span>76</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-san-thong-nhat">S&#226;n Thống Nhất<span>72</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-sieu-thi-sai-gon">Si&#234;u thị S&#224;i G&#242;n<span>62</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-cong-vien-le-thi-rieng">C&#244;ng Vi&#234;n L&#234; Thị Ri&#234;ng<span>62</span></a></li>
                                        <li><a href="/ho-chi-minh/khu-vuc-hoa-hung">H&#242;a Hưng<span>45</span></a></li>
                                    </ul>
                                </div>
                                <div id="areas-show-all-block" class="viewmore">
                                    <a href="/ho-chi-minh/khu-vuc-quan-10" id="areas-show-all-link">Xem tất cả</a>
                                </div>
                            </div>
                        </div>
                        <script type="text/javascript">
                            $(function () {
                                $('#areas-show-all-link').click(function () {
                                    $('#areas-block').css('height', 'auto');
                                    $('#areas-show-all-block').remove();
                                });
                            });
                        </script>

                        <!--End of keywords category box-->
                        <!--end of latest review box -->



                        <!--Start keywords category box-->

                        <!--End of keywords category box-->
                    </div>

                    <!--End of Right content -->
                </div>
                <!--End of micro content-->
            </div>
        </div>